/**
 * 
 */
package br.ufal.ic.sd.project.server.enumeration;

import java.util.ArrayList;
import java.util.List;

/**
 * @author keven andrade
 *
 */
public enum LogType {
       
    
    FATAL(1,"FATAL"),
    ERROR(2,"ERROR"),
    WARN(3,"WARN"),
    INFO(4,"INFO"),
    DEBUG(5,"DEBUG"),
    TRACE(6, "TRACE");
    
    private int intId;
    private String strLogName;
    
    /**
     * @Construtor
     * @param intId
     * @param strLogName
     */
    private LogType(int intId, String strLogName) {
	
	this.intId = intId;
	this.strLogName = strLogName;
	
    }
    
    /**
     * @return a list of LogType
     */
    public static List<LogType> getListCommand() {

	List<LogType> listLogType = new ArrayList<LogType>();
	int i = 1;

	while (LogType.getCommand(i) != null) {
	    listLogType.add(LogType.getCommand(i++));
	}
	return listLogType;
    }
    
    /**
     * @return a LogType by is id
    */
    public static LogType getCommand(int intId) {
	
	switch (intId) {
		case 1:
		    return LogType.FATAL;
		case 2:
		    return LogType.ERROR;
		case 3:
		    return LogType.WARN;
		case 4:
		    return LogType.INFO;
		case 5:
		    return LogType.DEBUG;
		default:
		    return null;
	}
}


}
